//
//  Turtle.h
//  NinjaTurtle
//
//  Created by Nguyen Tri Chung on 1/31/15.
//
//

#ifndef __NinjaTurtle__Turtle__
#define __NinjaTurtle__Turtle__

#include <stdio.h>
#include "cocos2d.h"
#include "Obj.h"

class Turtle : public Obj {
    CC_SYNTHESIZE(MoveState, moveState, MoveState);
    CC_SYNTHESIZE(string, equipment, Equipment);

    CC_SYNTHESIZE(bool, dead, Dead);
    CC_SYNTHESIZE(bool, disappear, Disappear);
    CC_SYNTHESIZE(bool, jumping, Jumping);
    CC_SYNTHESIZE(bool, slashing, Slashing);
    CC_SYNTHESIZE(bool, throwing, Throwing);
    CC_SYNTHESIZE(bool, performingSecondJump, PerformingSecondJump);
    CC_SYNTHESIZE(bool, insideTeleport, InsideTeleport);
    
    CC_SYNTHESIZE(float, currentJumpHeight, CurrentJumpHeight);
    CC_SYNTHESIZE(float, targetJumpHeight, TargetJumpHeight);
    CC_SYNTHESIZE(float, currentElapsedJumpTime, CurrentElapsedJumpTime);
    CC_SYNTHESIZE(float, jumpHeight, JumpHeight);
    CC_SYNTHESIZE(float, moveSpeed, MoveSpeed);
    CC_SYNTHESIZE(float, lastStepY, LastStepY);
    
    CC_SYNTHESIZE(float, currentThrowDelay, CurrentThrowDelay);
    CC_SYNTHESIZE(float, throwDelay, ThrowDelay);
public:
    Turtle();
    virtual ~Turtle();
    
    void initBody();
    void move(MoveState moveState);
    void update(float dt);
    bool jump(float suddenHeight = 0);
    void equip(const string& equipment);

    string getStateThrow();
    string getStateSlash();
    string getStatePush();
    string getStateDie();
    string getStateFall();
    string getStateJump();
    string getStateMove();
    string getStateIdle();
};

#endif /* defined(__NinjaTurtle__Turtle__) */
